#include "ndame.h"
Go to the source code of this file.
Functions | |
void | options (struct data *d1) |
options |
Definition in file options.c.
|
options Options is a sub menu where you can change the default values like boardlength, filename,save(jes,no),singlestep(jes no) and exit options . When you restart the programme settings will not be saved.
Definition at line 22 of file options.c. References automatic, chessboard(), clrbox(), data::iblength, data::m1, manual, MAX_SIZE, MIN_SIZE, and state(). 00023 { 00024 char cselect; 00025 00026 clrbox(1); 00027 chessboard(d1); 00028 00029 do 00030 { 00031 //select one 00032 gotoxy(2,5); 00033 printf("(1) - Bordersize"); 00034 gotoxy(2,6); 00035 printf("(2) - Singlestep"); 00036 gotoxy(2,7); 00037 printf("(3) - Save"); 00038 gotoxy(2,8); 00039 printf("(4) - Filename"); 00040 gotoxy(2,10); 00041 printf("(5) - Exit Options"); 00042 00043 cselect=getch(); 00044 switch(cselect) 00045 { 00046 case '1': 00047 if(d1->iblength<MAX_SIZE) 00048 { 00049 d1->iblength++; //increment bordlengh 00050 } 00051 else 00052 { 00053 d1->iblength=MIN_SIZE; //set boardlength to MIN_SIZE 00054 } 00055 if(d1->iblength==MIN_SIZE) 00056 { 00057 clrbox(1); 00058 } 00059 chessboard(d1); 00060 state(d1,1); //refresh status 00061 break; 00062 00063 case '2': //Singlestep 00064 if(d1->m1==automatic) 00065 { 00066 d1->m1=manual; 00067 } 00068 else 00069 { 00070 d1->m1=automatic; 00071 } 00072 state(d1,2); //refresh status 00073 break; 00074 00075 case '3': 00076 if(d1->isave==0) 00077 { 00078 d1->isave=1; //1 means save = yes 00079 } 00080 else 00081 { 00082 d1->isave=0; //0 means save = no 00083 } 00084 state(d1,3); //refresh status 00085 break; 00086 00087 case '4': 00088 clrbox(0); 00089 filename(d1); 00090 break; 00091 00092 case 'e': 00093 exit(1); //exit the whole programme 00094 break; 00095 } 00096 00097 }while(cselect!='5'); //options exit 00098 00099 clrbox(0); 00100 clrbox(1); 00101 }
|